package com.ruicar.afs.cloud.afscase.job.approve;

import com.ruicar.afs.cloud.afscase.processor.service.ApproveWorkflowService;
import com.ruicar.afs.cloud.common.job.core.biz.model.ReturnT;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJob;
import com.ruicar.afs.cloud.common.job.core.handler.annotation.AfsJobHandler;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description 人员离岗待审核案件回收至待分配，仅处理常规审批
 * @Author Peng Jinbo
 * @Date 2020/10/12 10:41
 */
@AfsJob
@Component
@AllArgsConstructor
@Slf4j
public class NotOnlineTaskRecycleJob {

    private ApproveWorkflowService approveWorkflowService;

    @AfsJobHandler("notOnlineTaskRecycleJob")
    public ReturnT notOnlineTaskRecycleJob(String param){
        try {
            approveWorkflowService.cronNotOnlineTaskRecycle();
            return ReturnT.SUCCESS;
        }catch (Exception e){
            return new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
        }

    }

}
